
<canvas id="myChart" width="400" height="200"></canvas>
<script>
$(function () {
   var hour = @json($hours);
   var hour_num = @json($hour_num);//时段人数值
   var ctx = document.getElementById("myChart").getContext('2d');
   var data ={
       type: 'line',
       data: {
           labels: hour,
           datasets: [{
               label: '当日在线人数时段统计(小时)',
               data: hour_num,
               backgroundColor: 'rgba(255, 99, 132, 0.6)',
               borderColor: 'rgba(255,99,132,1)',
               borderWidth: 1
           }]
       },
       options: {
           scales: {
               yAxes: [{
                   ticks: {
                       beginAtZero:true
                   }
               }]
           }
       }
   };
   var myChart = new Chart(ctx,data);
});
</script>
